<?php

class Application_Form_Category extends Zend_Form
{
	
        public function __construct()
	{
            $translate = new My_Action_Helper_Lang();
            
            $this->setName('category');
            parent::__construct();

            $category = new Zend_Form_Element_Text('name');
            $category//->setLabel($translate->_('Category'))
                     ->setRequired(true)
                     ->addValidator('NotEmpty')
                     ->addValidator('Alnum')
                     ->addFilter('StringTrim')
                     ->addFilter('StripTags');

            $icon = new Zend_Form_Element_File('icon');
            $icon->addValidator('Size', false, 1024000)
                 ->addValidator('Extension', false, 'jpg,png,gif');


            $submit = new Zend_Form_Element_Submit('submit');
            $submit->setLabel($translate->_('Add category'))
                   ->setAttrib('class', 'button');

            $this->addElements(array($category, $icon, $submit));
	}
}